package by.amakarevich.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.amakarevich.datamodel.Booking;
import by.amakarevich.datamodel.BookingInfo;
import by.amakarevich.datamodel.Product;
import by.amakarevich.datamodel.ShoppingCartInfo;
import by.amakarevich.datamodel.UserAccount;

public interface BookingInfoService {
	
	@Transactional
	void addNewBookingInfo(BookingInfo bookingInfo, UserAccount userAccount, Booking booking, Product product);
	
	@Transactional
	BookingInfo get(Long id);
	
	@Transactional
	void updateBookingInfo(BookingInfo bookingInfo);
	
	@Transactional
    void deleteAll();
	
	List<BookingInfo> getAllBookingInfo();

    List<BookingInfo> getAllBookingInfoByBooking(SingularAttribute<BookingInfo, ?> attr, boolean ascending, int startRecord, int pageSize);
    
    @Transactional
    void deleteBookingInfo(Long id);
    
    List<BookingInfo> getAllByBooking(Booking booking);
    
    BookingInfo getByBookingInfoId(Long bookingInfoId);
    
    @Transactional
    void fromShoppingCartToBooking(ShoppingCartInfo shoppingCartInfo, UserAccount userAccount, Booking booking);
	
}
